package com.hongning.railway.ui.main.fragments.cadremanagement.viewmodel;

import android.databinding.ObservableField;
import android.support.annotation.NonNull;
import android.text.TextUtils;

import com.hongning.railway.entity.resbean.ResKaoHeListBean;
import com.hongning.railway.ui.main.fragments.cadremanagement.CadreReslutFragmentViewModel;

import me.goldze.mvvmhabit.base.ItemViewModel;

public class CadreReslutFragmentItemViewModel extends ItemViewModel<CadreReslutFragmentViewModel> {
    public ObservableField<String> name = new ObservableField<>();
    public ObservableField<String> part = new ObservableField<>();
    public ObservableField<String> id = new ObservableField<>();
    public ObservableField<String> score = new ObservableField<>();
    public ObservableField<String> level = new ObservableField<>();
    public ObservableField<String> ganbuscore = new ObservableField<>();
    public ObservableField<String> leaderscore = new ObservableField<>();
    public ObservableField<String> ganbushuzhiscore = new ObservableField<>();
    public CadreReslutFragmentItemViewModel(@NonNull CadreReslutFragmentViewModel viewModel, ResKaoHeListBean.DataBean data) {
        super(viewModel);
        name.set(data.getStaffname());
        if (TextUtils.isEmpty(data.getDlevelid())){
            part.set("职务：暂无");
        }else {
            part.set("职务："+data.getDlevelid());
        }

        id.set("工号："+data.getStaffid());
        score.set(data.getComprehensivescore()+"分");
        level.set(data.getRating());
        ganbuscore.set("干部互评 "+data.getCadresscore());
        leaderscore.set("领导评定 "+data.getLeaderscore());
        ganbushuzhiscore.set("干部述职 "+data.getReportingscore());
    }
}
